﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ChromeProvider.cs" company="">
//   
// </copyright>
// <summary>
//   The chrome provider.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace UITest.Selenium.WebDrivers
{
    using OpenQA.Selenium.Chrome;
    using OpenQA.Selenium.Remote;

    /// <summary>
    ///     The chrome provider.
    /// </summary>
    public class ChromeProvider : IRemoteWebDriverProvider
    {
        #region Public Methods and Operators

        /// <summary>
        /// The new driver.
        /// </summary>
        /// <returns>
        /// The <see cref="RemoteWebDriver"/>.
        /// </returns>
        public RemoteWebDriver NewDriver()
        {
            var options = new ChromeOptions();
            options.AddArguments("start-maximized");
            options.AddUserProfilePreference("download.default_directory", @"c:\tmp");
            options.AddUserProfilePreference("download.prompt_for_download", false);
            var driver = new ChromeDriver(options);
            return driver;
        }

        #endregion
    }
}